﻿using System;
using System.Collections.Generic;
using System.Text;

namespace MyLibrary.SequenceRunner
{
    /// <summary>
    /// 执行步骤类
    /// </summary>
    internal class ExecuteStep
    {
        public ExecuteStep()
        {
        }

        string _assemblyPath;
        string _assemblyClass;
        Dictionary<string, string> _methodsName = null;
        Dictionary<string, string> _attributes = null;
        bool _exitOnError;
        string _assemblyParams = String.Empty;
        /// <summary>
        /// 程序集路径
        /// </summary>
        public string AssemblyPath
        {
            get { return _assemblyPath; }
            set { _assemblyPath = value; }
        }

        /// <summary>
        /// 程序集中的类
        /// </summary>
        public string AssemblyClass
        {
            get { return _assemblyClass; }
            set { _assemblyClass = value; }
        }

        /// <summary>
        /// 实例化类的参数
        /// </summary>
        public string AssemblyParams
        {
            get { return _assemblyParams; }
            set { _assemblyParams = value; }
        }

        /// <summary>
        /// 方法集
        /// </summary>
        public Dictionary<string, string> MethodsName
        {
            get
            {
                if (_methodsName == null)
                    _methodsName = new Dictionary<string, string>();
                return _methodsName;
            }
            set
            {
                _methodsName = value;
            }
        }

        /// <summary>
        /// 属性集
        /// </summary>
        public Dictionary<string, string> Attributes
        {
            get
            {
                if (_attributes == null)
                    _attributes = new Dictionary<string, string>();
                return _attributes;
            }
            set { _attributes = value; }
        }

        /// <summary>
        /// 如果方法执行错误是否退出
        /// </summary>
        public bool ExitOnError
        {
            get { return _exitOnError; }
            set { _exitOnError = value; }
        }
    }
}
